# -*- coding: utf-8 -*-
from django.contrib import admin

from jiqixuexi.cms.models import *


class AuthorAdmin(admin.ModelAdmin):
    list_display = ('first_name', 'last_name', 'email')
    search_fields = ('first_name', 'last_name')


class ArticleAdmin(admin.ModelAdmin):
    list_display = ('title', 'digest', 'img')
    list_filter = ('title',)

    class Media:
        js = ('/static/tinymce/tinymce.min.js',  '/static/js/tinymce-custom.js')



class TagAdmin(admin.ModelAdmin):
    list_display = ('name', 'color')
    list_filter = ('name',)


class CategoryAdmin(admin.ModelAdmin):
    list_display = ('name', 'parent')
    list_filter = ('name',)

admin.site.register(Article, ArticleAdmin)
admin.site.register(Category, CategoryAdmin)
admin.site.register(Tag, TagAdmin)
admin.site.register(Link)
admin.site.register(Menu)